﻿using System;
using System.Windows.Forms;

namespace LeChatApp
{
    public partial class Connect : Form
    {
        public bool isSubmitted { get; set; }

        public Connect()
        {
            InitializeComponent();
        }

        private void pressEnterToSubmit(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                btnConnect_Click(sender, e);
        }

        private void btnConnect_Click(object sender, EventArgs e)
        {
            isSubmitted = true;
            Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            isSubmitted = false;
            Close();
        }

        private void chkSecureConnect_CheckedChanged(object sender, EventArgs e)
        {
            if (chkSecureConnect.Checked)
            {
                lbl_PortSsl.Visible = true;
                txt_PortSsl.Visible = true;
                Height = Height + 31;
            }
            else
            {
                lbl_PortSsl.Visible = false;
                txt_PortSsl.Visible = false;
                Height = Height - 31;
            }
        }
    }
}
